/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

::selection {
    color: hsl(var(--bg));
    background: hsl(var(--action));
}

input, button, textarea, select {
    font: inherit;
}

/* Try to uniform scrollbars at least a bit */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-thumb {
    background-color: hsl(var(--bg-high));
    border-radius: 30px;
}

::-webkit-scrollbar-corner {
    display: none;
}

/* some parts are disabled until we actually have a theme switch and fixed all components */
body {
    width: 100%;
    height: 100dvh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5rem;
    color: hsl(var(--text));
    background-color: hsl(var(--bg));
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    overflow: auto;

    display: flex;
    --animate-zoom: zoomIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --din-a4-width: 595pt;
    --din-a4-height: 842pt;
}

a, a:link, a:visited {
    color: hsl(var(--text));
    transition: all 150ms ease-in-out;
}

a:hover, a:active {
    color: hsl(var(--action));
    text-decoration: underline;
}

blockquote {
    padding-left: .33rem;
    border-left: 3px solid hsl(var(--accent));
    border-radius: var(--border-radius);
    background-color: hsl(var(--bg-high));
}

code {
    padding: 0 .15rem;
    font-size: .9rem;
    background: hsl(var(--bg-high));
}

h1, h2, h3, h4, h5, h6 {
    color: hsl(var(--text-high));
    overflow-wrap: break-word;
}

h1 {
    font-size: 1.5rem;
    margin: 1rem 0;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 1.35rem;
    margin: .75rem 0;
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.25rem;
    margin: .6rem 0;
    letter-spacing: -0.025em;
}

h4 {
    font-size: 1.2rem;
    margin: .65rem 0;
    letter-spacing: -0.015em;
}

h5 {
    font-size: 1.05rem;
    margin: .55rem 0;
    letter-spacing: -0.01em;
}

p {
    margin: .5rem 0;
    /*
    595pt is exactly the width of DIN A4, the height would be 842pt.
    If you calculate for typical borders of  2.0 - 2.5 cm you get 57pt - 71pt on each side.
    To match typical DIN A4 writing widths, keep the max-width between 595 - 2 * 57 and 595 - 2 * 71 pt,
    meaning between 453pt and 481pt.
    Usually, you have 2,5cm on left, top, bottom, and 2cm on the right side, which will result in 467pt.
    */
    max-width: 467pt;
}

hr {
    border: none;
    border-top: 1px solid hsl(var(--bg-high));
    margin: .5rem 0;
}

li {
    margin-left: 1rem;
}

.font-default {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.font-label {
    font-family: ui-rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT',
    'Arial Rounded MT Bold', Calibri, source-sans-pro, sans-serif;
}

.font-mono {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas,
    'DejaVu Sans Mono', monospace;
}

.absolute {
    position: absolute
}

.accent {
    color: hsl(var(--accent));
}

.action {
    color: hsl(var(--action));
}

.clip {
    overflow: clip;
}

.err {
    color: hsl(var(--error));
}

.relative {
    position: relative
}

.flex {
    display: flex;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.flex-col {
    display: flex;
    flex-direction: column
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-3 {
    flex: 3;
}

.gap-05 {
    gap: .5rem
}

.gap-10 {
    gap: 1rem
}

.gap-15 {
    gap: 1.5rem
}

.gap-20 {
    gap: 2rem
}

.hidden {
    height: 0;
    width: 0;
    display: none;
}

.m-05 {
    margin: .5rem
}

.m-10 {
    margin: 1rem;
}

.ms-05 {
    margin: 0 .5rem;
}

.ms-10 {
    margin: 0 1rem;
}

.mh-05 {
    margin: .5rem 0;
}

.mh-10 {
    margin: 1rem 0;
}

.noselect {
    user-select: none;
}

.pointer {
    cursor: pointer;
}

.space-between {
    justify-content: space-between;
}

.text {
    color: hsl(var(--text));
}

.zoom {
    animation: var(--animate-zoom);
}

label[data-required="true"]:after {
    content: ' *';
    color: hsla(var(--error) / .9);
}

input {
    width: 100%;
    margin: .33rem 0;
    padding: .25rem .5rem;
    background: hsl(var(--bg));
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: hsl(var(--text));
    font-size: 1.05rem;
    outline: none;
    transition: 150ms all;
}

input:valid {
    border-bottom: 1px solid hsla(var(--text) / .35);
}

input:invalid {
    border-bottom: 1px solid hsl(var(--error));
}

input:hover, input:focus {
    color: hsl(var(--text-high));
    background: hsla(var(--action) / .03);
}

input:disabled {
    background: hsl(var(--bg-high));
    cursor: not-allowed;
}

.fade-in {
    animation: fadeIn 200ms;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
    }
    to {
        transform: scale(1);
    }
}
